]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
viewSelector: stop launching app from empty search
authorHashem Nasarat <hnasarat@gmail.com>
Sun, 27 Jan 2013 19:00:59 +0000 (14:00 -0500)
committerRui Matos <tiagomatos@gmail.com>
Sun, 27 Jan 2013 19:29:26 +0000 (20:29 +0100)
In the overview, when there is no text in the search entry, this._searchActive
will be set to false. Moving the Clutter.Return code block ensures that
pressing enter in the search field after deleting the characters of a search
will no longer launch the #1 application for the previous search.

https://bugzilla.gnome.org/show_bug.cgi?id=692391

js/ui/viewSelector.js

index c45057c9a42ba42632494af6b9aeb5e764d16723..06cd436aad33b8d11d9f70df5298b57450716e6b 100644 (file)
@@ -368,15 +368,6 @@ const ViewSelector = new Lang.Class({
                 this.reset();
                 return true;
             }
-        } else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
-            // We can't connect to 'activate' here because search providers
-            // might want to do something with the modifiers in activateDefault.
-            if (this._searchTimeoutId > 0) {
-                Mainloop.source_remove(this._searchTimeoutId);
-                this._doSearch();
-            }
-            this._searchResults.activateDefault();
-            return true;
         } else if (this._searchActive) {
             let arrowNext, nextDirection;
             if (entry.get_text_direction() == Clutter.TextDirection.RTL) {
@@ -401,6 +392,15 @@ const ViewSelector = new Lang.Class({
             } else if (symbol == arrowNext && this._text.position == -1) {
                 this._searchResults.navigateFocus(nextDirection);
                 return true;
+            } else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) {
+                // We can't connect to 'activate' here because search providers
+                // might want to do something with the modifiers in activateDefault.
+                if (this._searchTimeoutId > 0) {
+                    Mainloop.source_remove(this._searchTimeoutId);
+                    this._doSearch();
+                }
+                this._searchResults.activateDefault();
+                return true;
             }
         }
         return false;